package com.quanyan.place.mapper;

import com.quanyan.place.entity.apireq.ReqBusinessAwardVo;
import com.quanyan.place.entity.vo.BusinessAwardUserVo;
import com.quanyan.place.entity.vo.PlaceVisitStatisVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface TbBizPlaceBusinessRewardRuleManagerMapper {

    /**
     * 根据条件设置系数
     * @param map
     * @return
     */
    int updateByCondition(@Param("map") Map<String, Object> map);

    /**
     * 添加商务代表指标
     * @param map
     * @return
     */
    int insertAgentStatis(@Param("map") Map<String, Object> map);

    /**
     * 查询有效访问及新有效拜访
     * @param map
     * @return
     */
    List<PlaceVisitStatisVo> selectIsEffectiveByCondition(@Param("map") Map<String, Object> map);

    /**
     * 查询整馆、时段、包片
     * @param map
     * @return
     */
    List<PlaceVisitStatisVo> selectPlaceTypeByCondition(@Param("map") Map<String, Object> map);

    /**
     * 获取场馆订单营业额（按月）
     * @param map
     * @return
     */
    BigDecimal getPlaceOrderDebit(@Param("map") Map<String, Object> map);


    /**
     * 获取商务主管月奖金
     * @param map
     * @return
     */
    BigDecimal getAgentMonthAward(@Param("map") Map<String, Object> map);


    /**
     * 获取签订场馆个数
     * @param map
     * @return
     */
    BigDecimal getAgentBuyPlaceCount(@Param("map") Map<String, Object> map);

    /**
     * 获取签订时段个数
     * @param map
     * @return
     */
    BigDecimal getAgentBuyTimesCount(@Param("map") Map<String, Object> map);

    /**
     * 获取场馆年限
     * @param map
     * @return
     */
    Integer getPlaceBuyContract(@Param("map") Map<String, Object> map);

    /**
     * 获取商务代表目标数
     * @param map
     * @return
     */
    Integer getAgentTarget(@Param("map") Map<String, Object> map);

    /**
     * 商务代表签约的场馆
     * @param map
     * @return
     */
    List<Integer> getPlaceIdByUid(@Param("map") Map<String, Object> map);

    /**
     * 根据场馆id查询周一到周五黄金时段
     * @param map
     * @return
     */
    Integer getMonToFriPrimeTimes(@Param("map") Map<String, Object> map);

    /**
     * 根据场馆id查询周六到周天黄金时段
     * @param map
     * @return
     */
    Integer getSatToSunPrimeTimes(@Param("map") Map<String, Object> map);


    /**
     * 商务代表List
     * @param reqBusinessAwardVo
     * @return
     */
    List<BusinessAwardUserVo> getBusinessAgent(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 商务代表记录数
     * @param reqBusinessAwardVo
     * @return
     */
    Integer countByCondition(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 商务主管List
     * @param reqBusinessAwardVo
     * @return
     */
    List<BusinessAwardUserVo> getBusinessManager(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 商务主管记录数
     * @param reqBusinessAwardVo
     * @return
     */
    Integer getBusinessManagerCount(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 城市经理List
     * @param reqBusinessAwardVo
     * @return
     */
    List<BusinessAwardUserVo> getCityManager(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 城市经理记录数
     * @param reqBusinessAwardVo
     * @return
     */
    Integer getCityManagerCount(@Param("reqBusinessAwardVo")ReqBusinessAwardVo reqBusinessAwardVo);

    /**
     * 批量更新底薪
     * @param reqBusinessAwardVo
     * @return
     */
    Integer updateBatchUserSalary(@Param("reqBusinessAwardVo") ReqBusinessAwardVo reqBusinessAwardVo);
}